package com.orhonit.ipb.portal.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

import com.orhonit.ipb.portal.configuration.EmailConfig;



/**
 * 邮件工具类
 * @author 	刘阳
 * @date	2018年4月23日13:47:59
 */
// @Component
public class EmailUtils {

	@Autowired
	private EmailConfig emailConfig;
	@Autowired
	private JavaMailSender mailSender;

	/**
	 * 发送简单邮件
	 * @param sendTo	发送到
	 * @param titel		标题
	 * @param content	内容
	 */
	public void sendSimpleMail(String sendTo, String titel, String content) {
		SimpleMailMessage message = new SimpleMailMessage();
	//	message.setFrom(emailConfig.getEmailFrom());
		message.setTo(sendTo);
		message.setSubject(titel);
		message.setText(content);
		
		mailSender.send(message);
	}
}
